Skip to content

Instantly share code, notes, and snippets.

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@jazibobs
jazibobs / instagram-image-source.html
Last active April 6, 2026 18:52
Get a link to the image file from an instagram url
<!--
Use a standard instagram url such as https://www.instagram.com/p/BB70H3bMEH-/
at the end of the link append media/?size=THE_IMAGE_SIZE_YOU_WANT
-->
<!-- Get the image file as a thumbnail -->
<img src="https://www.instagram.com/p/BB70H3bMEH-/media/?size=t" alt="Instagram Image Thumbnail">
<!-- Get the medium image file -->
<img src="https://www.instagram.com/p/BB70H3bMEH-/media/?size=m" alt="Instagram Image Medium">
@vamitul
vamitul / rollup.config.mjs
Created April 2, 2026 18:14
Minimal Rollup config example for bundling UXPScripts, with sourcemap support in UDT
import path from 'node:path';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import sourcemaps from 'rollup-plugin-sourcemaps2';
/* global process */
const uxpCleanSourcemap = () => {
const projectRoot = process.cwd();
return {